local wezterm = require('wezterm')
local colors = require('colors.custom')
-- local fonts = require('config.fonts')

return {
   term = 'xterm-256color',
   animation_fps = 60,
   max_fps = 100,
   front_end = 'WebGpu',
   webgpu_power_preference = 'HighPerformance',

   -- color scheme
   -- colors = colors,
   -- color_scheme = 'Gruvbox dark, medium (base16)',
   -- color_scheme = 'Catppuccin Mocha',
   color_scheme = 'tokyonight_moon',

   -- background
   -- window_background_opacity = 1,
   -- win32_system_backdrop = 'Acrylic',
   --文本和背景图对比度
   -- text_background_opacity = 0.55,

   --背景透明度更改
   macos_window_background_blur = 70,
   -- window_background_gradient = {
   --    colors = { '#1D261B', '#261A25' },
   --    -- Specifices a Linear gradient starting in the top left corner.
   --    orientation = { Linear = { angle = -45.0 } },
   -- },

   -- --背景图
   -- background = {
   --    {
   --       source = { File = wezterm.config_dir .. '/backdrops/mac.png' },
   --    },
   --    {
   --       source = { Color = '#1A1B26' },
   --       height = '100%',
   --       width = '100%',
   --       opacity = 0.97,
   --       -- opacity = 1,
   --    },
   -- },
   --

   -- background TODO 目前注释掉了，不喜欢花里胡哨了
   -- background = {
   --    {
   --       -- source = { File = wezterm.GLOBAL.background },
   --       source = { File = wezterm.config_dir .. '/backdrops/mac.png' },
   --    },
   --    {
   --       source = { Color = colors.background },
   --       height = '100%',
   --       width = '100%',
   --       opacity = 0.96,
   --    },
   -- },

   -- scrollbar
   -- 加了滑动栏有一些违和
   enable_scroll_bar = false,
   min_scroll_bar_height = '3cell',
   colors = {
      scrollbar_thumb = '#34354D',
   },

   -- tab bar
   enable_tab_bar = true,
   --只有一个tab时隐藏tab bar
   hide_tab_bar_if_only_one_tab = true,
   use_fancy_tab_bar = false,
   tab_max_width = 25,
   show_tab_index_in_tab_bar = true,
   switch_to_last_active_tab_when_closing_tab = false,

   -- cursor
   default_cursor_style = 'BlinkingBlock',
   cursor_blink_ease_in = 'Constant',
   cursor_blink_ease_out = 'Constant',
   cursor_blink_rate = 700,

   -- window
   adjust_window_size_when_changing_font_size = false,
   -- window_decorations = 'INTEGRATED_BUTTONS|RESIZE',
   ---禁用标题栏，但启用可调整大小的边框
   window_decorations = 'RESIZE',

   -- show terminal tab bar
   show_new_tab_button_in_tab_bar = false,
   --当设置为 false 时，新选项卡按钮将不会绘制到选项卡栏中。

   integrated_title_button_style = 'Windows',
   integrated_title_button_color = 'auto',
   integrated_title_button_alignment = 'Right',
   initial_cols = 120,
   initial_rows = 24,
   window_padding = {
      --使得glazewm和wezterm的窗口在显示屏的位置更加协调不会出现挨着太紧的问题
      -- left = 20,
      -- right = 20,
      -- top = 20,
      -- bottom = 5,

      left = 0,
      right = 0,
      top = 0,
      bottom = 0,
   },

   -- window_close_confirmation = 'AlwaysPrompt',
   -- 不习惯每次关闭都提示，烦死了
   window_close_confirmation = 'NeverPrompt',

   window_frame = {
      active_titlebar_bg = '#0F2536',
      inactive_titlebar_bg = '#0F2536',
      -- font = fonts.font,
      -- font_size = fonts.font_size,
   },
   inactive_pane_hsb = { saturation = 1.0, brightness = 1.0 },
}
